package com.gopay.common.id;

import java.io.Serializable;

/**
 * Global unique id
 */
public class GUID implements Serializable{

    private Long id;

    private long timestamp;

    private long workerId;

    private long sequence;

    private WorkerId worker;

    public GUID(Long id) {
        this.id = id;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public long getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(long timestamp) {
        this.timestamp = timestamp;
    }

    public long getWorkerId() {
        return workerId;
    }

    public void setWorkerId(long workerId) {
        this.workerId = workerId;
    }

    public long getSequence() {
        return sequence;
    }

    public void setSequence(long sequence) {
        this.sequence = sequence;
    }

    public WorkerId getWorker() {
        return worker;
    }

    public void setWorker(WorkerId worker) {
        this.worker = worker;
    }

    @Override
    public String toString() {
        return "GUID{" +
                "id=" + id +
                ", timestamp=" + timestamp +
                ", workerId=" + workerId +
                ", sequence=" + sequence +
                ", worker=" + worker +
                '}';
    }
}
